package com.shopping.serviceImpl;

import com.shopping.dao.ProductSpecDao;
import com.shopping.pojo.ProductSpec;
import com.shopping.service.ProductSpecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductSpecServiceImpl implements ProductSpecService {
    @Autowired
    private ProductSpecDao productSpecDao;


    @Override
    public List<ProductSpec> selectProductSpecByProductId(Integer productId) {
        return productSpecDao.selectProductSpecByProductId(productId);
    }

    @Override
    public int getProductSpecNum(Integer productId) {
        return productSpecDao.getProductSpecNum(productId);
    }

    @Override
    public boolean insertProductSpec(ProductSpec productSpec) {
        return productSpecDao.insertProductSpec(productSpec)>0;
    }

    @Override
    public boolean updateProductSpec(ProductSpec productSpec) {
        return productSpecDao.updateProductSpec(productSpec)>0;
    }

    @Override
    public boolean deleteProductSpec(Integer id) {
        return productSpecDao.deleteProductSpec(id)>0;
    }
}
